/*
Source : https://leetcode.com/problems/reverse-integer/
Author : nflush@outlook.com
Date   : 2016-05-06
*/
/*
263. Ugly Number  
Total Accepted: 55163 Total Submissions: 150261 Difficulty: Easy

Write a program to check whether a given number is an ugly number.

Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly since it includes another prime factor 7.

Note that 1 is typically treated as an ugly number.

Credits:
Special thanks to @jianchao.li.fighter for adding this problem and creating all test cases.

Subscribe to see which companies asked this question
*/

bool isUgly(int num) {
    if (num < 1) return false;
    if (num == 1) return true;
    printf("%d\n", num);
    while (num % 2 == 0) num/=2;
    while (num % 3 == 0) num/=3;
    while (num % 5 == 0) num/=5;
//    printf("%d\n", num);
    return num == 1;
}

bool isUgly(int num) {
    switch(num){
    case 1:
    case 5:
    case 3:
    case 2:
    case 4:
    case 8:
    case 16:
    case 32:
    case 64:
    case 128:
    case 256:
    case 512:
    case 1024:
    case 2048:
    case 4096:
    case 8192:
    case 16384:
    case 32768:
    case 65536:
    case 131072:
    case 262144:
    case 524288:
    case 1048576:
    case 2097152:
    case 4194304:
    case 8388608:
    case 16777216:
    case 33554432:
    case 67108864:
    case 134217728:
    case 268435456:
    case 536870912:
    case 1073741824:
    case 9:
    case 6:
    case 12:
    case 24:
    case 48:
    case 96:
    case 192:
    case 384:
    case 768:
    case 1536:
    case 3072:
    case 6144:
    case 12288:
    case 24576:
    case 49152:
    case 98304:
    case 196608:
    case 393216:
    case 786432:
    case 1572864:
    case 3145728:
    case 6291456:
    case 12582912:
    case 25165824:
    case 50331648:
    case 100663296:
    case 201326592:
    case 402653184:
    case 805306368:
    case 1610612736:
    case 27:
    case 18:
    case 36:
    case 72:
    case 144:
    case 288:
    case 576:
    case 1152:
    case 2304:
    case 4608:
    case 9216:
    case 18432:
    case 36864:
    case 73728:
    case 147456:
    case 294912:
    case 589824:
    case 1179648:
    case 2359296:
    case 4718592:
    case 9437184:
    case 18874368:
    case 37748736:
    case 75497472:
    case 150994944:
    case 301989888:
    case 603979776:
    case 1207959552:
    case 81:
    case 54:
    case 108:
    case 216:
    case 432:
    case 864:
    case 1728:
    case 3456:
    case 6912:
    case 13824:
    case 27648:
    case 55296:
    case 110592:
    case 221184:
    case 442368:
    case 884736:
    case 1769472:
    case 3538944:
    case 7077888:
    case 14155776:
    case 28311552:
    case 56623104:
    case 113246208:
    case 226492416:
    case 452984832:
    case 905969664:
    case 1811939328:
    case 243:
    case 162:
    case 324:
    case 648:
    case 1296:
    case 2592:
    case 5184:
    case 10368:
    case 20736:
    case 41472:
    case 82944:
    case 165888:
    case 331776:
    case 663552:
    case 1327104:
    case 2654208:
    case 5308416:
    case 10616832:
    case 21233664:
    case 42467328:
    case 84934656:
    case 169869312:
    case 339738624:
    case 679477248:
    case 1358954496:
    case 729:
    case 486:
    case 972:
    case 1944:
    case 3888:
    case 7776:
    case 15552:
    case 31104:
    case 62208:
    case 124416:
    case 248832:
    case 497664:
    case 995328:
    case 1990656:
    case 3981312:
    case 7962624:
    case 15925248:
    case 31850496:
    case 63700992:
    case 127401984:
    case 254803968:
    case 509607936:
    case 1019215872:
    case 2038431744:
    case 2187:
    case 1458:
    case 2916:
    case 5832:
    case 11664:
    case 23328:
    case 46656:
    case 93312:
    case 186624:
    case 373248:
    case 746496:
    case 1492992:
    case 2985984:
    case 5971968:
    case 11943936:
    case 23887872:
    case 47775744:
    case 95551488:
    case 191102976:
    case 382205952:
    case 764411904:
    case 1528823808:
    case 6561:
    case 4374:
    case 8748:
    case 17496:
    case 34992:
    case 69984:
    case 139968:
    case 279936:
    case 559872:
    case 1119744:
    case 2239488:
    case 4478976:
    case 8957952:
    case 17915904:
    case 35831808:
    case 71663616:
    case 143327232:
    case 286654464:
    case 573308928:
    case 1146617856:
    case 19683:
    case 13122:
    case 26244:
    case 52488:
    case 104976:
    case 209952:
    case 419904:
    case 839808:
    case 1679616:
    case 3359232:
    case 6718464:
    case 13436928:
    case 26873856:
    case 53747712:
    case 107495424:
    case 214990848:
    case 429981696:
    case 859963392:
    case 1719926784:
    case 59049:
    case 39366:
    case 78732:
    case 157464:
    case 314928:
    case 629856:
    case 1259712:
    case 2519424:
    case 5038848:
    case 10077696:
    case 20155392:
    case 40310784:
    case 80621568:
    case 161243136:
    case 322486272:
    case 644972544:
    case 1289945088:
    case 177147:
    case 118098:
    case 236196:
    case 472392:
    case 944784:
    case 1889568:
    case 3779136:
    case 7558272:
    case 15116544:
    case 30233088:
    case 60466176:
    case 120932352:
    case 241864704:
    case 483729408:
    case 967458816:
    case 1934917632:
    case 531441:
    case 354294:
    case 708588:
    case 1417176:
    case 2834352:
    case 5668704:
    case 11337408:
    case 22674816:
    case 45349632:
    case 90699264:
    case 181398528:
    case 362797056:
    case 725594112:
    case 1451188224:
    case 1594323:
    case 1062882:
    case 2125764:
    case 4251528:
    case 8503056:
    case 17006112:
    case 34012224:
    case 68024448:
    case 136048896:
    case 272097792:
    case 544195584:
    case 1088391168:
    case 4782969:
    case 3188646:
    case 6377292:
    case 12754584:
    case 25509168:
    case 51018336:
    case 102036672:
    case 204073344:
    case 408146688:
    case 816293376:
    case 1632586752:
    case 14348907:
    case 9565938:
    case 19131876:
    case 38263752:
    case 76527504:
    case 153055008:
    case 306110016:
    case 612220032:
    case 1224440064:
    case 43046721:
    case 28697814:
    case 57395628:
    case 114791256:
    case 229582512:
    case 459165024:
    case 918330048:
    case 1836660096:
    case 129140163:
    case 86093442:
    case 172186884:
    case 344373768:
    case 688747536:
    case 1377495072:
    case 387420489:
    case 258280326:
    case 516560652:
    case 1033121304:
    case 2066242608:
    case 1162261467:
    case 774840978:
    case 1549681956:

    case 25:
    case 15:
    case 10:
    case 20:
    case 40:
    case 80:
    case 160:
    case 320:
    case 640:
    case 1280:
    case 2560:
    case 5120:
    case 10240:
    case 20480:
    case 40960:
    case 81920:
    case 163840:
    case 327680:
    case 655360:
    case 1310720:
    case 2621440:
    case 5242880:
    case 10485760:
    case 20971520:
    case 41943040:
    case 83886080:
    case 167772160:
    case 335544320:
    case 671088640:
    case 1342177280:
    case 45:
    case 30:
    case 60:
    case 120:
    case 240:
    case 480:
    case 960:
    case 1920:
    case 3840:
    case 7680:
    case 15360:
    case 30720:
    case 61440:
    case 122880:
    case 245760:
    case 491520:
    case 983040:
    case 1966080:
    case 3932160:
    case 7864320:
    case 15728640:
    case 31457280:
    case 62914560:
    case 125829120:
    case 251658240:
    case 503316480:
    case 1006632960:
    case 2013265920:
    case 135:
    case 90:
    case 180:
    case 360:
    case 720:
    case 1440:
    case 2880:
    case 5760:
    case 11520:
    case 23040:
    case 46080:
    case 92160:
    case 184320:
    case 368640:
    case 737280:
    case 1474560:
    case 2949120:
    case 5898240:
    case 11796480:
    case 23592960:
    case 47185920:
    case 94371840:
    case 188743680:
    case 377487360:
    case 754974720:
    case 1509949440:
    case 405:
    case 270:
    case 540:
    case 1080:
    case 2160:
    case 4320:
    case 8640:
    case 17280:
    case 34560:
    case 69120:
    case 138240:
    case 276480:
    case 552960:
    case 1105920:
    case 2211840:
    case 4423680:
    case 8847360:
    case 17694720:
    case 35389440:
    case 70778880:
    case 141557760:
    case 283115520:
    case 566231040:
    case 1132462080:
    case 1215:
    case 810:
    case 1620:
    case 3240:
    case 6480:
    case 12960:
    case 25920:
    case 51840:
    case 103680:
    case 207360:
    case 414720:
    case 829440:
    case 1658880:
    case 3317760:
    case 6635520:
    case 13271040:
    case 26542080:
    case 53084160:
    case 106168320:
    case 212336640:
    case 424673280:
    case 849346560:
    case 1698693120:
    case 3645:
    case 2430:
    case 4860:
    case 9720:
    case 19440:
    case 38880:
    case 77760:
    case 155520:
    case 311040:
    case 622080:
    case 1244160:
    case 2488320:
    case 4976640:
    case 9953280:
    case 19906560:
    case 39813120:
    case 79626240:
    case 159252480:
    case 318504960:
    case 637009920:
    case 1274019840:
    case 10935:
    case 7290:
    case 14580:
    case 29160:
    case 58320:
    case 116640:
    case 233280:
    case 466560:
    case 933120:
    case 1866240:
    case 3732480:
    case 7464960:
    case 14929920:
    case 29859840:
    case 59719680:
    case 119439360:
    case 238878720:
    case 477757440:
    case 955514880:
    case 1911029760:
    case 32805:
    case 21870:
    case 43740:
    case 87480:
    case 174960:
    case 349920:
    case 699840:
    case 1399680:
    case 2799360:
    case 5598720:
    case 11197440:
    case 22394880:
    case 44789760:
    case 89579520:
    case 179159040:
    case 358318080:
    case 716636160:
    case 1433272320:
    case 98415:
    case 65610:
    case 131220:
    case 262440:
    case 524880:
    case 1049760:
    case 2099520:
    case 4199040:
    case 8398080:
    case 16796160:
    case 33592320:
    case 67184640:
    case 134369280:
    case 268738560:
    case 537477120:
    case 1074954240:
    case 295245:
    case 196830:
    case 393660:
    case 787320:
    case 1574640:
    case 3149280:
    case 6298560:
    case 12597120:
    case 25194240:
    case 50388480:
    case 100776960:
    case 201553920:
    case 403107840:
    case 806215680:
    case 1612431360:
    case 885735:
    case 590490:
    case 1180980:
    case 2361960:
    case 4723920:
    case 9447840:
    case 18895680:
    case 37791360:
    case 75582720:
    case 151165440:
    case 302330880:
    case 604661760:
    case 1209323520:
    case 2657205:
    case 1771470:
    case 3542940:
    case 7085880:
    case 14171760:
    case 28343520:
    case 56687040:
    case 113374080:
    case 226748160:
    case 453496320:
    case 906992640:
    case 1813985280:
    case 7971615:
    case 5314410:
    case 10628820:
    case 21257640:
    case 42515280:
    case 85030560:
    case 170061120:
    case 340122240:
    case 680244480:
    case 1360488960:
    case 23914845:
    case 15943230:
    case 31886460:
    case 63772920:
    case 127545840:
    case 255091680:
    case 510183360:
    case 1020366720:
    case 2040733440:
    case 71744535:
    case 47829690:
    case 95659380:
    case 191318760:
    case 382637520:
    case 765275040:
    case 1530550080:
    case 215233605:
    case 143489070:
    case 286978140:
    case 573956280:
    case 1147912560:
    case 645700815:
    case 430467210:
    case 860934420:
    case 1721868840:
    case 1937102445:
    case 1291401630:
    case 125:
    case 75:
    case 50:
    case 100:
    case 200:
    case 400:
    case 800:
    case 1600:
    case 3200:
    case 6400:
    case 12800:
    case 25600:
    case 51200:
    case 102400:
    case 204800:
    case 409600:
    case 819200:
    case 1638400:
    case 3276800:
    case 6553600:
    case 13107200:
    case 26214400:
    case 52428800:
    case 104857600:
    case 209715200:
    case 419430400:
    case 838860800:
    case 1677721600:
    case 225:
    case 150:
    case 300:
    case 600:
    case 1200:
    case 2400:
    case 4800:
    case 9600:
    case 19200:
    case 38400:
    case 76800:
    case 153600:
    case 307200:
    case 614400:
    case 1228800:
    case 2457600:
    case 4915200:
    case 9830400:
    case 19660800:
    case 39321600:
    case 78643200:
    case 157286400:
    case 314572800:
    case 629145600:
    case 1258291200:
    case 675:
    case 450:
    case 900:
    case 1800:
    case 3600:
    case 7200:
    case 14400:
    case 28800:
    case 57600:
    case 115200:
    case 230400:
    case 460800:
    case 921600:
    case 1843200:
    case 3686400:
    case 7372800:
    case 14745600:
    case 29491200:
    case 58982400:
    case 117964800:
    case 235929600:
    case 471859200:
    case 943718400:
    case 1887436800:
    case 2025:
    case 1350:
    case 2700:
    case 5400:
    case 10800:
    case 21600:
    case 43200:
    case 86400:
    case 172800:
    case 345600:
    case 691200:
    case 1382400:
    case 2764800:
    case 5529600:
    case 11059200:
    case 22118400:
    case 44236800:
    case 88473600:
    case 176947200:
    case 353894400:
    case 707788800:
    case 1415577600:
    case 6075:
    case 4050:
    case 8100:
    case 16200:
    case 32400:
    case 64800:
    case 129600:
    case 259200:
    case 518400:
    case 1036800:
    case 2073600:
    case 4147200:
    case 8294400:
    case 16588800:
    case 33177600:
    case 66355200:
    case 132710400:
    case 265420800:
    case 530841600:
    case 1061683200:
    case 2123366400:
    case 18225:
    case 12150:
    case 24300:
    case 48600:
    case 97200:
    case 194400:
    case 388800:
    case 777600:
    case 1555200:
    case 3110400:
    case 6220800:
    case 12441600:
    case 24883200:
    case 49766400:
    case 99532800:
    case 199065600:
    case 398131200:
    case 796262400:
    case 1592524800:
    case 54675:
    case 36450:
    case 72900:
    case 145800:
    case 291600:
    case 583200:
    case 1166400:
    case 2332800:
    case 4665600:
    case 9331200:
    case 18662400:
    case 37324800:
    case 74649600:
    case 149299200:
    case 298598400:
    case 597196800:
    case 1194393600:
    case 164025:
    case 109350:
    case 218700:
    case 437400:
    case 874800:
    case 1749600:
    case 3499200:
    case 6998400:
    case 13996800:
    case 27993600:
    case 55987200:
    case 111974400:
    case 223948800:
    case 447897600:
    case 895795200:
    case 1791590400:
    case 492075:
    case 328050:
    case 656100:
    case 1312200:
    case 2624400:
    case 5248800:
    case 10497600:
    case 20995200:
    case 41990400:
    case 83980800:
    case 167961600:
    case 335923200:
    case 671846400:
    case 1343692800:
    case 1476225:
    case 984150:
    case 1968300:
    case 3936600:
    case 7873200:
    case 15746400:
    case 31492800:
    case 62985600:
    case 125971200:
    case 251942400:
    case 503884800:
    case 1007769600:
    case 2015539200:
    case 4428675:
    case 2952450:
    case 5904900:
    case 11809800:
    case 23619600:
    case 47239200:
    case 94478400:
    case 188956800:
    case 377913600:
    case 755827200:
    case 1511654400:
    case 13286025:
    case 8857350:
    case 17714700:
    case 35429400:
    case 70858800:
    case 141717600:
    case 283435200:
    case 566870400:
    case 1133740800:
    case 39858075:
    case 26572050:
    case 53144100:
    case 106288200:
    case 212576400:
    case 425152800:
    case 850305600:
    case 1700611200:
    case 119574225:
    case 79716150:
    case 159432300:
    case 318864600:
    case 637729200:
    case 1275458400:
    case 358722675:
    case 239148450:
    case 478296900:
    case 956593800:
    case 1913187600:
    case 1076168025:
    case 717445350:
    case 1434890700:
    case 625:
    case 375:
    case 250:
    case 500:
    case 1000:
    case 2000:
    case 4000:
    case 8000:
    case 16000:
    case 32000:
    case 64000:
    case 128000:
    case 256000:
    case 512000:
    case 1024000:
    case 2048000:
    case 4096000:
    case 8192000:
    case 16384000:
    case 32768000:
    case 65536000:
    case 131072000:
    case 262144000:
    case 524288000:
    case 1048576000:
    case 2097152000:
    case 1125:
    case 750:
    case 1500:
    case 3000:
    case 6000:
    case 12000:
    case 24000:
    case 48000:
    case 96000:
    case 192000:
    case 384000:
    case 768000:
    case 1536000:
    case 3072000:
    case 6144000:
    case 12288000:
    case 24576000:
    case 49152000:
    case 98304000:
    case 196608000:
    case 393216000:
    case 786432000:
    case 1572864000:
    case 3375:
    case 2250:
    case 4500:
    case 9000:
    case 18000:
    case 36000:
    case 72000:
    case 144000:
    case 288000:
    case 576000:
    case 1152000:
    case 2304000:
    case 4608000:
    case 9216000:
    case 18432000:
    case 36864000:
    case 73728000:
    case 147456000:
    case 294912000:
    case 589824000:
    case 1179648000:
    case 10125:
    case 6750:
    case 13500:
    case 27000:
    case 54000:
    case 108000:
    case 216000:
    case 432000:
    case 864000:
    case 1728000:
    case 3456000:
    case 6912000:
    case 13824000:
    case 27648000:
    case 55296000:
    case 110592000:
    case 221184000:
    case 442368000:
    case 884736000:
    case 1769472000:
    case 30375:
    case 20250:
    case 40500:
    case 81000:
    case 162000:
    case 324000:
    case 648000:
    case 1296000:
    case 2592000:
    case 5184000:
    case 10368000:
    case 20736000:
    case 41472000:
    case 82944000:
    case 165888000:
    case 331776000:
    case 663552000:
    case 1327104000:
    case 91125:
    case 60750:
    case 121500:
    case 243000:
    case 486000:
    case 972000:
    case 1944000:
    case 3888000:
    case 7776000:
    case 15552000:
    case 31104000:
    case 62208000:
    case 124416000:
    case 248832000:
    case 497664000:
    case 995328000:
    case 1990656000:
    case 273375:
    case 182250:
    case 364500:
    case 729000:
    case 1458000:
    case 2916000:
    case 5832000:
    case 11664000:
    case 23328000:
    case 46656000:
    case 93312000:
    case 186624000:
    case 373248000:
    case 746496000:
    case 1492992000:
    case 820125:
    case 546750:
    case 1093500:
    case 2187000:
    case 4374000:
    case 8748000:
    case 17496000:
    case 34992000:
    case 69984000:
    case 139968000:
    case 279936000:
    case 559872000:
    case 1119744000:
    case 2460375:
    case 1640250:
    case 3280500:
    case 6561000:
    case 13122000:
    case 26244000:
    case 52488000:
    case 104976000:
    case 209952000:
    case 419904000:
    case 839808000:
    case 1679616000:
    case 7381125:
    case 4920750:
    case 9841500:
    case 19683000:
    case 39366000:
    case 78732000:
    case 157464000:
    case 314928000:
    case 629856000:
    case 1259712000:
    case 22143375:
    case 14762250:
    case 29524500:
    case 59049000:
    case 118098000:
    case 236196000:
    case 472392000:
    case 944784000:
    case 1889568000:
    case 66430125:
    case 44286750:
    case 88573500:
    case 177147000:
    case 354294000:
    case 708588000:
    case 1417176000:
    case 199290375:
    case 132860250:
    case 265720500:
    case 531441000:
    case 1062882000:
    case 2125764000:
    case 597871125:
    case 398580750:
    case 797161500:
    case 1594323000:
    case 1793613375:
    case 1195742250:
    case 3125:
    case 1875:
    case 1250:
    case 2500:
    case 5000:
    case 10000:
    case 20000:
    case 40000:
    case 80000:
    case 160000:
    case 320000:
    case 640000:
    case 1280000:
    case 2560000:
    case 5120000:
    case 10240000:
    case 20480000:
    case 40960000:
    case 81920000:
    case 163840000:
    case 327680000:
    case 655360000:
    case 1310720000:
    case 5625:
    case 3750:
    case 7500:
    case 15000:
    case 30000:
    case 60000:
    case 120000:
    case 240000:
    case 480000:
    case 960000:
    case 1920000:
    case 3840000:
    case 7680000:
    case 15360000:
    case 30720000:
    case 61440000:
    case 122880000:
    case 245760000:
    case 491520000:
    case 983040000:
    case 1966080000:
    case 16875:
    case 11250:
    case 22500:
    case 45000:
    case 90000:
    case 180000:
    case 360000:
    case 720000:
    case 1440000:
    case 2880000:
    case 5760000:
    case 11520000:
    case 23040000:
    case 46080000:
    case 92160000:
    case 184320000:
    case 368640000:
    case 737280000:
    case 1474560000:
    case 50625:
    case 33750:
    case 67500:
    case 135000:
    case 270000:
    case 540000:
    case 1080000:
    case 2160000:
    case 4320000:
    case 8640000:
    case 17280000:
    case 34560000:
    case 69120000:
    case 138240000:
    case 276480000:
    case 552960000:
    case 1105920000:
    case 151875:
    case 101250:
    case 202500:
    case 405000:
    case 810000:
    case 1620000:
    case 3240000:
    case 6480000:
    case 12960000:
    case 25920000:
    case 51840000:
    case 103680000:
    case 207360000:
    case 414720000:
    case 829440000:
    case 1658880000:
    case 455625:
    case 303750:
    case 607500:
    case 1215000:
    case 2430000:
    case 4860000:
    case 9720000:
    case 19440000:
    case 38880000:
    case 77760000:
    case 155520000:
    case 311040000:
    case 622080000:
    case 1244160000:
    case 1366875:
    case 911250:
    case 1822500:
    case 3645000:
    case 7290000:
    case 14580000:
    case 29160000:
    case 58320000:
    case 116640000:
    case 233280000:
    case 466560000:
    case 933120000:
    case 1866240000:
    case 4100625:
    case 2733750:
    case 5467500:
    case 10935000:
    case 21870000:
    case 43740000:
    case 87480000:
    case 174960000:
    case 349920000:
    case 699840000:
    case 1399680000:
    case 12301875:
    case 8201250:
    case 16402500:
    case 32805000:
    case 65610000:
    case 131220000:
    case 262440000:
    case 524880000:
    case 1049760000:
    case 2099520000:
    case 36905625:
    case 24603750:
    case 49207500:
    case 98415000:
    case 196830000:
    case 393660000:
    case 787320000:
    case 1574640000:
    case 110716875:
    case 73811250:
    case 147622500:
    case 295245000:
    case 590490000:
    case 1180980000:
    case 332150625:
    case 221433750:
    case 442867500:
    case 885735000:
    case 1771470000:
    case 996451875:
    case 664301250:
    case 1328602500:
    case 1992903750:
    case 15625:
    case 9375:
    case 6250:
    case 12500:
    case 25000:
    case 50000:
    case 100000:
    case 200000:
    case 400000:
    case 800000:
    case 1600000:
    case 3200000:
    case 6400000:
    case 12800000:
    case 25600000:
    case 51200000:
    case 102400000:
    case 204800000:
    case 409600000:
    case 819200000:
    case 1638400000:
    case 28125:
    case 18750:
    case 37500:
    case 75000:
    case 150000:
    case 300000:
    case 600000:
    case 1200000:
    case 2400000:
    case 4800000:
    case 9600000:
    case 19200000:
    case 38400000:
    case 76800000:
    case 153600000:
    case 307200000:
    case 614400000:
    case 1228800000:
    case 84375:
    case 56250:
    case 112500:
    case 225000:
    case 450000:
    case 900000:
    case 1800000:
    case 3600000:
    case 7200000:
    case 14400000:
    case 28800000:
    case 57600000:
    case 115200000:
    case 230400000:
    case 460800000:
    case 921600000:
    case 1843200000:
    case 253125:
    case 168750:
    case 337500:
    case 675000:
    case 1350000:
    case 2700000:
    case 5400000:
    case 10800000:
    case 21600000:
    case 43200000:
    case 86400000:
    case 172800000:
    case 345600000:
    case 691200000:
    case 1382400000:
    case 759375:
    case 506250:
    case 1012500:
    case 2025000:
    case 4050000:
    case 8100000:
    case 16200000:
    case 32400000:
    case 64800000:
    case 129600000:
    case 259200000:
    case 518400000:
    case 1036800000:
    case 2073600000:
    case 2278125:
    case 1518750:
    case 3037500:
    case 6075000:
    case 12150000:
    case 24300000:
    case 48600000:
    case 97200000:
    case 194400000:
    case 388800000:
    case 777600000:
    case 1555200000:
    case 6834375:
    case 4556250:
    case 9112500:
    case 18225000:
    case 36450000:
    case 72900000:
    case 145800000:
    case 291600000:
    case 583200000:
    case 1166400000:
    case 20503125:
    case 13668750:
    case 27337500:
    case 54675000:
    case 109350000:
    case 218700000:
    case 437400000:
    case 874800000:
    case 1749600000:
    case 61509375:
    case 41006250:
    case 82012500:
    case 164025000:
    case 328050000:
    case 656100000:
    case 1312200000:
    case 184528125:
    case 123018750:
    case 246037500:
    case 492075000:
    case 984150000:
    case 1968300000:
    case 553584375:
    case 369056250:
    case 738112500:
    case 1476225000:
    case 1660753125:
    case 1107168750:
    case 78125:
    case 46875:
    case 31250:
    case 62500:
    case 125000:
    case 250000:
    case 500000:
    case 1000000:
    case 2000000:
    case 4000000:
    case 8000000:
    case 16000000:
    case 32000000:
    case 64000000:
    case 128000000:
    case 256000000:
    case 512000000:
    case 1024000000:
    case 2048000000:
    case 140625:
    case 93750:
    case 187500:
    case 375000:
    case 750000:
    case 1500000:
    case 3000000:
    case 6000000:
    case 12000000:
    case 24000000:
    case 48000000:
    case 96000000:
    case 192000000:
    case 384000000:
    case 768000000:
    case 1536000000:
    case 421875:
    case 281250:
    case 562500:
    case 1125000:
    case 2250000:
    case 4500000:
    case 9000000:
    case 18000000:
    case 36000000:
    case 72000000:
    case 144000000:
    case 288000000:
    case 576000000:
    case 1152000000:
    case 1265625:
    case 843750:
    case 1687500:
    case 3375000:
    case 6750000:
    case 13500000:
    case 27000000:
    case 54000000:
    case 108000000:
    case 216000000:
    case 432000000:
    case 864000000:
    case 1728000000:
    case 3796875:
    case 2531250:
    case 5062500:
    case 10125000:
    case 20250000:
    case 40500000:
    case 81000000:
    case 162000000:
    case 324000000:
    case 648000000:
    case 1296000000:
    case 11390625:
    case 7593750:
    case 15187500:
    case 30375000:
    case 60750000:
    case 121500000:
    case 243000000:
    case 486000000:
    case 972000000:
    case 1944000000:
    case 34171875:
    case 22781250:
    case 45562500:
    case 91125000:
    case 182250000:
    case 364500000:
    case 729000000:
    case 1458000000:
    case 102515625:
    case 68343750:
    case 136687500:
    case 273375000:
    case 546750000:
    case 1093500000:
    case 307546875:
    case 205031250:
    case 410062500:
    case 820125000:
    case 1640250000:
    case 922640625:
    case 615093750:
    case 1230187500:
    case 1845281250:
    case 390625:
    case 234375:
    case 156250:
    case 312500:
    case 625000:
    case 1250000:
    case 2500000:
    case 5000000:
    case 10000000:
    case 20000000:
    case 40000000:
    case 80000000:
    case 160000000:
    case 320000000:
    case 640000000:
    case 1280000000:
    case 703125:
    case 468750:
    case 937500:
    case 1875000:
    case 3750000:
    case 7500000:
    case 15000000:
    case 30000000:
    case 60000000:
    case 120000000:
    case 240000000:
    case 480000000:
    case 960000000:
    case 1920000000:
    case 2109375:
    case 1406250:
    case 2812500:
    case 5625000:
    case 11250000:
    case 22500000:
    case 45000000:
    case 90000000:
    case 180000000:
    case 360000000:
    case 720000000:
    case 1440000000:
    case 6328125:
    case 4218750:
    case 8437500:
    case 16875000:
    case 33750000:
    case 67500000:
    case 135000000:
    case 270000000:
    case 540000000:
    case 1080000000:
    case 18984375:
    case 12656250:
    case 25312500:
    case 50625000:
    case 101250000:
    case 202500000:
    case 405000000:
    case 810000000:
    case 1620000000:
    case 56953125:
    case 37968750:
    case 75937500:
    case 151875000:
    case 303750000:
    case 607500000:
    case 1215000000:
    case 170859375:
    case 113906250:
    case 227812500:
    case 455625000:
    case 911250000:
    case 1822500000:
    case 512578125:
    case 341718750:
    case 683437500:
    case 1366875000:
    case 1537734375:
    case 1025156250:
    case 2050312500:
    case 1953125:
    case 1171875:
    case 781250:
    case 1562500:
    case 3125000:
    case 6250000:
    case 12500000:
    case 25000000:
    case 50000000:
    case 100000000:
    case 200000000:
    case 400000000:
    case 800000000:
    case 1600000000:
    case 3515625:
    case 2343750:
    case 4687500:
    case 9375000:
    case 18750000:
    case 37500000:
    case 75000000:
    case 150000000:
    case 300000000:
    case 600000000:
    case 1200000000:
    case 10546875:
    case 7031250:
    case 14062500:
    case 28125000:
    case 56250000:
    case 112500000:
    case 225000000:
    case 450000000:
    case 900000000:
    case 1800000000:
    case 31640625:
    case 21093750:
    case 42187500:
    case 84375000:
    case 168750000:
    case 337500000:
    case 675000000:
    case 1350000000:
    case 94921875:
    case 63281250:
    case 126562500:
    case 253125000:
    case 506250000:
    case 1012500000:
    case 2025000000:
    case 284765625:
    case 189843750:
    case 379687500:
    case 759375000:
    case 1518750000:
    case 854296875:
    case 569531250:
    case 1139062500:
    case 1708593750:
    case 9765625:
    case 5859375:
    case 3906250:
    case 7812500:
    case 15625000:
    case 31250000:
    case 62500000:
    case 125000000:
    case 250000000:
    case 500000000:
    case 1000000000:
    case 2000000000:
    case 17578125:
    case 11718750:
    case 23437500:
    case 46875000:
    case 93750000:
    case 187500000:
    case 375000000:
    case 750000000:
    case 1500000000:
    case 52734375:
    case 35156250:
    case 70312500:
    case 140625000:
    case 281250000:
    case 562500000:
    case 1125000000:
    case 158203125:
    case 105468750:
    case 210937500:
    case 421875000:
    case 843750000:
    case 1687500000:
    case 474609375:
    case 316406250:
    case 632812500:
    case 1265625000:
    case 1423828125:
    case 949218750:
    case 1898437500:
    case 48828125:
    case 29296875:
    case 19531250:
    case 39062500:
    case 78125000:
    case 156250000:
    case 312500000:
    case 625000000:
    case 1250000000:
    case 87890625:
    case 58593750:
    case 117187500:
    case 234375000:
    case 468750000:
    case 937500000:
    case 1875000000:
    case 263671875:
    case 175781250:
    case 351562500:
    case 703125000:
    case 1406250000:
    case 791015625:
    case 527343750:
    case 1054687500:
    case 2109375000:
    case 1582031250:
    case 244140625:
    case 146484375:
    case 97656250:
    case 195312500:
    case 390625000:
    case 781250000:
    case 1562500000:
    case 439453125:
    case 292968750:
    case 585937500:
    case 1171875000:
    case 1318359375:
    case 878906250:
    case 1757812500:
    case 1220703125:
    case 732421875:
    case 488281250:
    case 976562500:
    case 1953125000:
    case 1464843750:
        return true;
    default:
        return false;
    }
}

